Skip to content

Add Cloudflare DNS component.#15388

Merged
fabaff merged 7 commits intohome-assistant:devfrom
ludeeus:cloudflare
Jul 9, 2018
Merged

Add Cloudflare DNS component.#15388
fabaff merged 7 commits intohome-assistant:devfrom
ludeeus:cloudflare

Conversation

@ludeeus
Copy link
Copy Markdown
Member

@ludeeus ludeeus commented Jul 9, 2018

Description:

This component will update all A records in the defined zone with the external IP of the host running Home Assistant.

optional: if a list list records is defined, only those wil be updated.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5723

Example entry for configuration.yaml (if applicable):

cloudflare:
  email: user@example.com
  api_key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41
  zone: example.com
  records:
    - bin
    - www

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Comment thread homeassistant/components/cloudflare.py Outdated
if result is not True:
_LOGGER.warning(result)
return True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line at end of file

fabaff
fabaff previously requested changes Jul 9, 2018
Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is requires a test or needs to be added to .coveragerc.

@fabaff fabaff dismissed their stale review July 9, 2018 20:41

First check then click...

Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🐦

@fabaff fabaff merged commit c5a2ffb into home-assistant:dev Jul 9, 2018
@ghost ghost removed the in progress label Jul 9, 2018

if result is not True:
_LOGGER.warning(result)
return True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing is checking this return value.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may be a side effect of me usually doing bash, where you should return a value from a funtion/method to tell the parent script that you are done.

This is not needed in Python?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not needed. It also makes the code confusing. Only return something if it's going to be used. On the other hand, if a function should return something, it should always return something. Return values should be consistent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okei, I will add a PR to remove that line

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awarecan pushed a commit to awarecan/home-assistant that referenced this pull request Jul 16, 2018
* Add Cloudflare DNS component

* Removed man

* Update .coveragerc

* Update cloudflare.py

* Update cloudflare.py

* Changed records to be required

* Fix typos, update order and other minor changes
@balloob balloob mentioned this pull request Jul 20, 2018
michaeldavie pushed a commit to michaeldavie/home-assistant that referenced this pull request Jul 31, 2018
* Add Cloudflare DNS component

* Removed man

* Update .coveragerc

* Update cloudflare.py

* Update cloudflare.py

* Changed records to be required

* Fix typos, update order and other minor changes
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* Add Cloudflare DNS component

* Removed man

* Update .coveragerc

* Update cloudflare.py

* Update cloudflare.py

* Changed records to be required

* Fix typos, update order and other minor changes
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants